#include "NYStylePizzaStore.h"
#include "NYPizzaIngredientFactory.h"
#include "CheesePizza.h"
#include "VeggiePizza.h"
#include "PepperoniPizza.h"
#include "ClamPizza.h"

#include <assert.h>

Pizza * NYStylePizzaStore::createPizza(std::string type){
    Pizza *pizza;
    PizzaIngredientFactory *ingredientFactory = new NYPizzaIngredientFactory();

    if (type == "Cheese") {
        pizza = new CheesePizza(ingredientFactory);
        pizza->setName("New York Style Cheese Pizza");
    }
    else if (type == "Veggie") {
        pizza = new VeggiePizza(ingredientFactory);
        pizza->setName("New York Style Veggie Pizza");
    }
    else if (type == "Pepperoni") {
        pizza = new PepperoniPizza(ingredientFactory);
        pizza->setName("New York Style Pepperoni Pizza");
    }
    else if (type == "Clam") {
        pizza = new ClamPizza(ingredientFactory);
        pizza->setName("New York Style Clam Pizza");
    }
    else {
        std::cout << "Invalid type!" << std::endl;
        assert(false);
    }

    return pizza;
}